using System;

namespace TrueCode.Core.EditableEntity
{
  [Flags]
  public enum EditableMode
  {
    [Obsolete]
    Updatable = 100,
    ReadOnly = 1,
    ReadWrite = 2,
    All = ReadOnly | Updatable | ReadWrite
  }

  [ AttributeUsage( AttributeTargets.Property, AllowMultiple = false, Inherited = true ) ]
  public class EditableAttribute : Attribute
  {
    private readonly EditableMode _mode;

    public EditableAttribute() : this( EditableMode.ReadWrite ){}
    public EditableAttribute( EditableMode mode )
    {
      _mode = mode;
    }

    public EditableMode Mode
    {
      get { return _mode; }
    }
  }
}